//
// FileSystem.h
// Usage: VFS interface
// CreateDate: 2009-05-06
// Author: MaJiuyue
//
#ifndef _FILESYSTEM_H_
#define _FILESYSTEM_H_

#include <NewLife.h>
#include <sys/types.h>

class File;
class Directory;
class FileSystem
{
protected:
	// Identify of this fs
	const char * m_ident;
	Directory * root;

public:
	FileSystem(const char * ident) : m_ident(ident) {}
	virtual ~FileSystem() { }

public:
	virtual int read(u32 inode, off_t off, size_t size, addr_t buf)=0;
	virtual int write(u32 inode, off_t off, size_t size, addr_t buf)=0;
	virtual File * TraversalPath(Directory *target, const char * path)=0;
	virtual Directory * GetRoot() { return root; }
};

#endif

